home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sea_cargo_encounter1.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  162 lines

  1.  
  2. # Jones 3D Cog Script
  3. #
  4. # SEA_Cargo_Encounter1.cog
  5. # Sets up a one time scripted encounter with some commies soon after Volodnikov is alerted to Indy's escape 
  6. #
  7. # [JM]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15. message         startup
  16. message         entered
  17. message         killed
  18.  
  19. # ==================== SUBROUTINES ===================
  20.  
  21. flex            attack          local
  22.  
  23. # =================== REFERENCES ===============================
  24.  
  25. thing           Commie00            LinkID=1
  26. thing           Commie01            LinkID=1
  27. thing           Commie02            LinkID=1     
  28.  
  29. surface         SurfaceTrigger00    LinkID=2
  30.  
  31. surface         AIActivate00        LinkID=3
  32. surface         AIActivate01        LinkID=3
  33. surface         AIActivate02        LinkID=3
  34.  
  35. surface         AIDeActivate00      LinkID=4
  36. surface         AIDeActivate01      LinkID=4
  37. surface         AIDeActivate02      LinkID=4
  38.  
  39. thing           SoundGhost00        
  40.  
  41. # ===================== MISC LOCAL VARIABLES ===================
  42.  
  43. int         counter             local
  44. int         StartCheck=0        local
  45. thing       TempCommie          local
  46.  
  47. # =========================== SOUNDS ============================
  48.  
  49. sound        DoorSound=sea_doors_open_c.wav      local
  50. sound           Chatter00=inxh3016.wav                  local
  51.  
  52.  
  53. # ==================== CONSTANTS ==========================
  54.  
  55. int         NUMBER_OF_COMMIES=3         local
  56. int         NUMBER_OF_DOORS=2           local #So that I can make it sound like two doors are opening, for dramatic effect
  57. flex        ATTACK_DELAY=0.5            local #Needed for timing if music is inserted at a later date
  58. flex        COMMIE_ACTIVATE_DELAY=0.5   local
  59.  
  60. end
  61.  
  62. # ======================= CODE =============================
  63. code
  64.  
  65. # =========================================================
  66. startup:
  67.     
  68.     for(counter = 0; counter < NUMBER_OF_COMMIES; counter = counter + 1)
  69.     {
  70.         SetThingFlags(Commie00[counter], 0x80000);
  71.     }
  72.     
  73.     return;
  74.     
  75. # =========================================================
  76. entered:
  77.     
  78.     if(GetSenderID() == 2)
  79.     {
  80.         if(StartCheck == 1) return;
  81.         
  82.         StartCheck = 1;
  83.         Call attack;
  84.     }
  85.     
  86.     return;
  87.  
  88. # =========================================================
  89. crossed:
  90.     
  91.     if(GetSenderID() == 3)
  92.     {
  93.         for(counter = 0; counter < NUMBER_OF_COMMIES; counter = counter + 1) 
  94.         {
  95.             if(Commie00[counter] != -1)
  96.                 AISetInstinctWpntMode(Commie00[counter]);
  97.                 AIEnableInstinct(Commie00[counter], "roam", 1);
  98.         }
  99.     }
  100.     else if(GetSenderID() == 4)
  101.     {
  102.         for(counter = 0; counter < NUMBER_OF_COMMIES; counter = counter + 1)
  103.         {
  104.             if(Commie00[counter] != -1)
  105.                 AIClearInstinctWpntMode(Commie00[counter]);
  106.                 AIEnableInstinct(Commie00[counter], "roam", 0);
  107.         }
  108.     }
  109.     
  110.     return;
  111.  
  112. # =========================================================
  113. killed:
  114.  
  115.     if(GetSenderID() == 1)
  116.     {
  117.         TempCommie = GetSenderRef();
  118.         
  119.         for(counter = 0; counter < NUMBER_OF_COMMIES; counter = counter + 1)
  120.         {
  121.             if(Commie00[counter] == TempCommie)
  122.             {
  123.                 Commie00[counter] = -1;
  124.             }
  125.         }
  126.     }
  127.     
  128.     return;
  129.     
  130. # =========================================================
  131. //The initial script for the three Commies Jumping Indy after his whip swing
  132. attack:
  133.  
  134.     sleep(ATTACK_DELAY);
  135.     
  136.     PlaySoundThing(DoorSound, SoundGhost00, 1.0, 5, 14, 0);
  137.     
  138.     sleep(COMMIE_ACTIVATE_DELAY);
  139.     
  140.     PlaySoundThing(Chatter00, SoundGhost00, 1.0, 2, 14, 0);
  141.     
  142.     for(counter = 0; counter < NUMBER_OF_COMMIES; counter = counter + 1)
  143.     {   
  144.         ClearThingFlags(Commie00[counter], 0x80000);
  145.             
  146.         AISetInstinctWpntMode(Commie00[counter]);
  147.         AIEnableInstinct(Commie00[counter], "roam", 1);
  148.         if(counter > 0)
  149.         {
  150.             AIWpntHuntTarget(Commie00[counter], 1.6, 0.0); # Two of the Commies hunt Indy Immediately while the first one (officer?) stays put
  151.         }
  152.         sleep(COMMIE_ACTIVATE_DELAY);
  153.     }
  154.     
  155.     return;
  156.  
  157. # ============================================================
  158.  
  159. end
  160.